package com.shijie.sjoj.model.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.shijie.sjoj.model.base.BasePojo;
import com.shijie.sjoj.model.pojo.base.CodeType;
import com.shijie.sjoj.model.pojo.base.JudgedInfo;
import lombok.Builder;
import lombok.Data;

import java.nio.file.Path;

/**
 * 判题类
 *
 * @author ZSJ
 */
@Data
@Builder
public class Judge implements BasePojo {

    /**
     * 代码
     */
    private String code;

    /**
     * 代码类型
     */
    private CodeType codeType;

    /**
     * 原型入参和原型结果类型（最末为原型结果类型）
     */
    private Class<?>[] paramsType;

    /**
     * 原型入参文件路径
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Path incomePath;

    /**
     * 原型结果文件路径
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Path outcomePath;

    /**
     * 解题完成信息
     */
    private JudgedInfo judgedInfo;

    public Judge() {
        this.code = null;
        this.codeType = null;
        this.paramsType = null;
        this.incomePath = null;
        this.outcomePath = null;
        this.judgedInfo = null;
    }

    public Judge(String code, CodeType codeType, Class<?>[] paramsType, Path incomePath, Path outcomePath, JudgedInfo judgedInfo) {
        this.code = code;
        this.codeType = codeType;
        this.paramsType = paramsType;
        this.incomePath = incomePath;
        this.outcomePath = outcomePath;
        this.judgedInfo = judgedInfo;
    }


}
